1. Field of the Invention
The present invention relates to a processor, and more particularly, to a processor with an adjustable operating frequency and method thereof.
2. Description of the Prior Art
A processor is an essential component for a computer system. The processor fetches program instructions and data from system memories, executes related logical or arithmetical operations on fetched data according to the program instructions, and sends back operation results to the system memories. Normally, the performance of a processor is decided by measuring the time of processing a specific task or a program. The time of processing a program for the processor can be expressed as: (number of instructions contained in the program)*(clock period of each instruction)*(length of a clock period). Consequently, the performance of the processor is determined by various parameters when being designed. Pipeline structure is a system architecture that can accelerate the throughput of the processor. Under the pipeline structure, all the tasks of the instruction are divided into a series of steps, and each step is referred to as a pipeline stage.
For example, most processors divide the tasks of an instruction into an instruction fetch stage, a decode stage, an execution stage, and a write back stage, where the execution stage usually takes up most of the time. As a result, a system is generally designed to have a clock period which allows the processor to process complicated instructions in the execution stage where the bottleneck almost always resides. If the clock period is too short, an execution error or an execution failure may occur while processing an instruction requiring longer time.